let baseURL = 'https://api.yssea.top';
function http(url,data,method="GET"){
	return new Promise((resolve,reject)=>{
		uni.request({
			url:baseURL + url,
			header:{
				"X-LC-Id": "hKyfke9yHid363hnI0IdUCSA-gzGzoHsz",
				"X-LC-Key": "PI9zq6sBRTAAlQaNXmLjqgRk",
				"Content-Type": "application/json"
			},
			method,
			data,
			success:(res)=>{
				resolve(res)
			},
			fail:(res)=>{
				reject(res)
			}
		})
	})
}
function get(url,data){
	return http(url,data,"GET")
}
function post(url,data){
	return http(url,data,"POST")
}
function put(url,data){
	return http(url,data,"PUT")
}
function del(url,data){
	return http(url,data,"DELETE")
}

export default {http,get,post,put,del}